#ifndef ANALYZER_H
#define	ANALYZER_H

#include "ast.h"
#include "symbol_table.h"

/**
 * Walk the AST and for each declarations list node it calls analyzer_set_declaration_type(AST* ast_node)
 *
 * @param declarations_list_node
 * @return 1 if there is at least one duplicated identifier, 0 otherwise
 */
int analyzer_check_for_duplicated_identifiers(AST* declarations_list_node);

/**
 * Checks if there is any not declared identifier in the hash table
 *
 * @param hash_table the hash table reference
 * @return 1 if there is at least one identifier not declared, 0 otherwise
 */
int analyzer_check_for_not_declared_identifier(HASH_TABLE* hash_table);

/**
 * Checks for bad use of identifiers.
 *
 * <p>
 * A bad use of an identifier is:
 * if A is an VAR identifier, it can not be used as a vector (indexed), or as a function call.
 * Another check that needs to be made is the identifier type and it's value type. A list of parameters
 * of a function must be respected when calling this function with arguments.
 * </p>
 *
 * @param root the AST root
 * @return 1 if there is at least one bad use of identifier, 0 otherwise
 */
int analyzer_check_identifier_use(AST* root);

#endif	/* ANALYZER_H */

